import { RouteRecordRaw } from "vue-router";
import { generateDocRouter, useDocRouterTree } from "./generateDocRouter";
generateDocRouter({isDoc: true});
const routes:RouteRecordRaw[] = [
    {
        'name': 'index',
        'path': '/',
        component: ()=>import('@/view/Index/index.vue'),
        meta: {
            title: '公益反霸凌组织'
        }
    },
    {
        name: 'doc',
        path: '/doc',
        component: ()=>import('@/view/doc/index.vue'),
        children: [...useDocRouterTree().children],
        redirect: '/doc/bullying',
        meta:{
            title: '什么是霸凌'
        }
    },
    {
        name: 'about',
        path: '/doc/about/introduce',
        component: ()=>import('@/view/doc/index.vue'),
        meta:{
            title: '关于我们'
        }
    },
    {
        name: '404',
        path: '/404',
        component: () => import('@/view/err/404.vue'),
    },
    {
        path: '/:pathMatch(.*)',
        redirect: '/404'
    }
]

export {routes};
